/**
 * Copyright (c) 2019 xstgongyi.org
 * All rights reserved.
 */
package org.xstgongyi.eduaid.controller;

import java.time.format.DateTimeFormatter;

import org.xstgongyi.eduaid.dataobject.ProjectDO;

/**
 * @author oldcrane<br/>
 * @created 2019-04-03
 */
class ProjectVO {

	private static final DateTimeFormatter simpleDateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;

	private Integer id;
	private String name;
	private String prefix;
	private String description;
	private String startDate; // pattern: "yyyy-MM-dd"
	// TODO 项目状态

	static ProjectVO of(ProjectDO projectDO) {
		ProjectVO vo = new ProjectVO();
		vo.setId(projectDO.getId());
		vo.setName(projectDO.getName());
		vo.setPrefix(projectDO.getPrefix());
		vo.setDescription(projectDO.getDescription());
		vo.setStartDate(simpleDateFormatter.format(projectDO.getStartDate()));
		return vo;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getPrefix() {
		return prefix;
	}

	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public String toString() {
		return "ProjectVO [id=" + id + ", name=" + name + ", prefix=" + prefix + ", description=" + description
				+ ", startDate=" + startDate + "]";
	}

}
